package com.gscitysfy.cus.drain.modules.reserveplan.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanControlInfo;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanLevelResponse;
import com.gscitysfy.cus.drain.modules.reserveplan.entity.DrainReservePlanMnCar;
import com.gscitysfy.cus.drain.modules.reserveplan.mapper.DrainReservePlanLevelResponseMapper;
import com.gscitysfy.cus.drain.modules.reserveplan.mapper.DrainReservePlanMnMaterialMapper;
import com.gscitysfy.cus.drain.modules.reserveplan.service.IDrainReservePlanLevelResponseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 预警等级对应的划分标准和响应机制信息表 服务实现类
 * </p>
 *
 * @author shenglin
 * @since 2022-11-15 14:28:05
 */
@Service
public class DrainReservePlanLevelResponseServiceImpl extends ServiceImpl<DrainReservePlanLevelResponseMapper, DrainReservePlanLevelResponse> implements IDrainReservePlanLevelResponseService {

    @Autowired
    private DrainReservePlanLevelResponseMapper drainReservePlanLevelResponseMapper;

    @Override
    public boolean deletByInfoId(List<String> infoIds) {
        LambdaQueryWrapper<DrainReservePlanLevelResponse> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(DrainReservePlanLevelResponse::getCmKid,infoIds);
        List<DrainReservePlanLevelResponse> drainReservePlanLevelResponses = drainReservePlanLevelResponseMapper.selectList(queryWrapper);
        for (DrainReservePlanLevelResponse drainReservePlanLevelRespons : drainReservePlanLevelResponses) {
            drainReservePlanLevelRespons.setCmUsable(true);
        }
        return this.updateBatchById(drainReservePlanLevelResponses);
    }
}
